<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
	<base href="<%= basePath%>">

<link href="jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<link href="jquery/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" />

<script type="text/javascript" src="jquery/jquery-1.11.1-min.js"></script>
<script type="text/javascript" src="jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="jquery/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="jquery/bootstrap-datetimepicker-master/locale/bootstrap-datetimepicker.zh-CN.js"></script>

	<%--jquery.bs_pagination分页插件包引入--%>
	<link rel="stylesheet" type="text/css" href="jquery/bs_pagination/jquery.bs_pagination.min.css">
	<script type="text/javascript" src="jquery/bs_pagination/jquery.bs_pagination.min.js"></script>
	<script type="text/javascript" src="jquery/bs_pagination/en.js"></script>
<script type="text/javascript">

	$(function(){
		$(".time").datetimepicker({
			minView:"month",
			language:"zh-CN",
			format: "yyyy-mm-dd",
			autoclose: true,
			todayBtn: true,
			pickerPosition: "bottom-left"
		});

		queryActivityByConditionForPage(1,10);

		//给创建保存按钮添加点击事件
		$("#create-save").click(function () {
	var fullname        = $.trim($("#create-fullname").val()) ;
	var appellation     = $("#create-appellation").val() ;
	var owner           = $("#create-owner").val() ;
	var company         = $.trim($("#create-company").val()) ;
	var job             = $.trim($("#create-job").val()) ;
	var email           = $.trim($("#create-email").val()) ;
	var phone           = $.trim($("#create-phone").val()) ;
	var website         = $.trim($("#create-website").val()) ;
	var mphone          = $.trim($("#create-mphone").val()) ;
	var state           = $.trim($("#create-state").val()) ;
	var source          = $.trim($("#create-source").val()) ;
	var description     = $.trim($("#create-description").val()) ;
	var contactSummary  = $.trim($("#create-contactSummary").val()) ;
	var nextContactTime = $.trim($("#create-nextContactTime").val());
	var address         = $.trim($("#create-address").val());

	var emailReg = /\w{3,}(\.\w+)*@[A-z0-9]+(\.[A-z]{2,5}){1,2}/;
    var phoneReg = /^(0\d{2,3}-?)?\d{7,8}$/;
	if(!emailReg.test(email)){
		alert("邮箱格式不符合规范！");
		$("#createClueModal").modal("show");
		return;
	}
	if(!phoneReg.test(phone)){
		alert("公司座机格式不符合规范！");
		$("#createClueModal").modal("show");
		return;
	}
	if (company==''){
		alert("公司不能为空！");
		$("#createClueModal").modal("show");
		return;
	}
	if(fullname==''){
		alert("姓名不能为空！")
		$("#createClueModal").modal("show");
		return;;
	}

	$.ajax({
		url:"workbench/clue/index/insertClue.do",
		data:{
		     fullname       :fullname       ,
			 appellation    :appellation    ,
			 owner          :owner          ,
			 company        :company        ,
			 job            :job            ,
			 email          :email          ,
			 phone          :phone          ,
			 website        :website        ,
			 mphone         :mphone         ,
			 state          :state          ,
			 source         :source         ,
			 description    :description    ,
			 contactSummary :contactSummary ,
			 nextContactTime:nextContactTime,
			 address        :address
		}   ,
		type:"post",
		dataType:"json",
		success:function (data) {
			 if(data.code=="1"){
			 	// $("#activityAddForm")[0].reset();
				 $("#clueAddForm")[0].reset()
				 queryActivityByConditionForPage(1,$("#demo_page1").bs_pagination('getOption','rowsPerPage'));
				 $("#createClueModal").modal("hide");
			 	alert("成功添加线索");
			 }   else {
			 	alert("添加线索失败");
			 }
		}
	});
		});

		//给查询按钮添加点击事件
		$("#searchBtn").click(function () {

			queryActivityByConditionForPage(1,$("#demo_page1").bs_pagination('getOption','rowsPerPage'));
		});

		//	给全选按钮添加点击事件
		$("#checkAll").click(function () {
			if(this.checked==true){
				$("#clueTbody input[type='checkbox']").prop("checked",true);
			}else {
				$("#clueTbody input[type='checkbox']").prop("checked",false);

			}
		});

		//判断是否全选
		$("#clueTbody").on("click","input[type='checkbox']",function () {
			if($("#clueTbody input[type='checkbox']").size()==$("#clueTbody input[type='checkbox']:checked").size())
			{
				$("#checkAll").prop("checked",true);
			}else {
				$("#checkAll").prop("checked",false);
			}
		})

		//给删除按钮添加点击事件
		$("#deleteBtn").click(function () {
			var checkedIds = $("#clueTbody input[type='checkbox']:checked");
			if(checkedIds.size()==0){
				alert("请选择要删除的市场活动");
				return;
			}
			if(window.confirm("您确定要删除吗？")){
				var id ="";
				$.each(checkedIds,function (index,obj) {
					if( index<(checkedIds.size()-1)) {
						id += "id=" + this.value + "&";
					}else {
						id +="id="+this.value;

					}
				})
				$.ajax({
					url:"workbench/clue/index/deleteClueById.do",
					data:id,
					dataType:"json",
					type:"post",
					success:function (data) {
						if (data.code=="1"){
							$("#checkAll").prop("checked",false);
							queryActivityByConditionForPage(1,$("#demo_page1").bs_pagination('getOption','rowsPerPage'));
							alert(data.message);
						}else {
							$("#checkAll").prop("checked",false);
							alert(data.message);
						}
					}
				});
			}
		});

	//	给修改按钮添加点击事件
		$("#editBtn").click(function () {
			$.ajax({
				url: 'workbench/activity/indexSelect.do',
				type:'get' ,
				dataType: 'json',
				success: function (data){
					var html = "";
					$.each(data,function (i,n){
						html += "<option value='"+n.id+"'>"+n.name+"</option>"
					})
					$("#edit-owner").html(html)

				}
			})
		});
		$("#editBtn").click(function () {
			$.ajax({
				url: 'workbench/clue/selectValueByTypeCode.do',
				type:'get' ,
				dataType: 'json',
				success: function (data){
					var htmlAppellationList = "";
					var htmlClueStateList ="";
					var htmlSourceList ="";
					$.each(data.appellationList,function (i,n){
						htmlAppellationList += "<option value='"+n.id+"'>"+n.value+"</option>"
					})
					$.each(data.clueStateList,function (i,n){
						htmlClueStateList += "<option value='"+n.id+"'>"+n.value+"</option>"
					})
					$.each(data.sourceList,function (i,n){
						htmlSourceList += "<option value='"+n.id+"'>"+n.value+"</option>"
					})
					$("#edit-appellation"). html(htmlAppellationList);
					$("#edit-state").html(htmlClueStateList);
					$("#edit-source").html(htmlSourceList);
				}
			})
		});
		$("#editBtn").click(function () {
			if($("#clueTbody input[type='checkbox']:checked").size()>1){
				alert("每次只可指定一个线索进行修改");
				return;
			}
			if ($("#clueTbody input[type='checkbox']:checked").size()==0){
				alert("请选择要修改的市场线索");
				return;
			}
			var id = $("#clueTbody input[type='checkbox']:checked").val();
			$.ajax({
				url:"workbench/clue/selectClueById.do",
				data:{
					id:id
				},
				dataType:"json",
				type:"post",
				success:function (data) {
					$("#edit-id").val(data.retData.id);
					$("#edit-fullname").val(data.retData.fullname);
					$("#edit-appellation").val(data.retData.appellation);
					$("#edit-owner").val(data.retData.owner);
					$("#edit-company").val(data.retData.company);
					$("#edit-job").val(data.retData.job);
					$("#edit-email").val(data.retData.email);
					$("#edit-phone").val(data.retData.phone);
					$("#edit-website").val(data.retData.website);
					$("#edit-mphone").val(data.retData.mphone);
					$("#edit-state").val(data.retData.state);
					$("#edit-source").val(data.retData.source);
					$("#edit-description").val(data.retData.description);
					$("#edit-contactSummary").val(data.retData.contactSummary);
					$("#edit-nextContactTime").val(data.retData.nextContactTime);
					$("#edit-address").val(data.retData.address);
					$("#editClueModal").modal("show");
				}
			});
		})


	//	给修改保存按钮添加点击事件
		$("#editSave").click(function () {
			var id = $.trim($("#edit-id").val());
			var fullname        = $.trim($("#edit-fullname").val()) ;
			var appellation     = $.trim($("#edit-appellation").val()) ;
			var owner           = $.trim($("#edit-owner").val()) ;
			var company         = $.trim($("#edit-company").val()) ;
			var job             = $.trim($("#edit-job").val()) ;
			var email           = $.trim($("#edit-email").val()) ;
			var phone           = $.trim($("#edit-phone").val()) ;
			var website         = $.trim($("#edit-website").val()) ;
			var mphone          = $.trim($("#edit-mphone").val()) ;
			var state           = $.trim($("#edit-state").val()) ;
			var source          = $.trim($("#edit-source").val()) ;
			var description     = $.trim($("#edit-description").val()) ;
			var contactSummary  = $.trim($("#edit-contactSummary").val()) ;
			var nextContactTime = $.trim($("#edit-nextContactTime").val());
			var address         = $.trim($("#edit-address").val());
			var emailReg = /\w{3,}(\.\w+)*@[A-z0-9]+(\.[A-z]{2,5}){1,2}/;
			var phoneReg = /^(0\d{2,3}-?)?\d{7,8}$/;
			if(!emailReg.test(email)){
				alert("邮箱格式不符合规范！");
				$("#editClueModal").modal("show");
				return;
			}
			if(!phoneReg.test(phone)){
				alert("公司座机格式不符合规范！");
				$("#editClueModal").modal("show");
				return;
			}
			if (company==''){
				alert("公司不能为空！");
				$("#editClueModal").modal("show");
				return;
			}
			if(fullname==''){
				alert("姓名不能为空！")
				$("#editClueModal").modal("show");
				return;
			}
			$.ajax({
				url:"workbench/clue/updateClueByClue.do",
				data:{
					id :id,
					fullname       :fullname       ,
					appellation    :appellation    ,
					owner          :owner          ,
					company        :company        ,
					job            :job            ,
					email          :email          ,
					phone          :phone          ,
					website        :website        ,
					mphone         :mphone         ,
					state          :state          ,
					source         :source         ,
					description    :description    ,
					contactSummary :contactSummary ,
					nextContactTime:nextContactTime,
					address        :address
				}   ,
				type:"post",
				dataType:"json",
				success:function (data) {
					if (data.code=="1"){
						alert("修改成功");
						$("#editClueModal").modal("hide");
						queryActivityByConditionForPage($("#demo_page1").bs_pagination('getOption','currentPage'),$("#demo_page1").bs_pagination('getOption','rowsPerPage'));
					}else {
						alert("修改失败");
						$("#editClueModal").modal("show");
						return;
					}
				}
			});
		});


	//	给创建按钮添加点击事件
		$("#addBtn").click(function (){

			$(".time").datetimepicker({
				minView:"month",
				language:"zh-CN",
				format: "yyyy-mm-dd",
				autoclose: true,
				todayBtn: true,
				pickerPosition: "bottom-left"
			});


					$("#createClueModal").modal("show");
		})
	});


	//按条件分页查询活动
	function queryActivityByConditionForPage(pageNo,pageSize) {

		var fullname  = $.trim($("#search-fullname").val());
		var  company = $.trim($("#search-company").val());
		var  phone= $.trim($("#search-phone").val());
		var  source= $.trim($("#search-source").val());
		var  owner = $.trim($("#search-owner").val());
		var  mphone= $.trim($("#search-mphone").val());
		var  state = $.trim($("#search-state").val());

		$.ajax({
			url:'workbench/clue/index/selectClueForPageByConditions.do',
			data:{
				fullname:fullname,
				company:company,
				phone:phone,
				source:source,
				owner:owner,
				mphone:mphone,
				state:state,
				pageNo:pageNo,
				pageSize:pageSize
			},
			type:'get',
			dataType:'json',
			success:function (data) {
				var htmlStr = "";
				$.each(data.clueList,function (index,obj) {
					htmlStr += '<tr>'
					htmlStr += '<td><input type="checkbox" value="'+obj.id+'" /></td>'
					htmlStr += '<td><a style="text-decoration: none; cursor: pointer;" onclick="window.location.href=\'workbench/clue/detail.do?id='+obj.id+'\'">'+obj.fullname+'</a></td>'
					htmlStr += '<td>'+obj.company+'</td>'
					htmlStr += '<td>'+obj.phone+'</td>'
					htmlStr += '<td>'+obj.mphone+'</td>'
					htmlStr += '<td>'+obj.source+'</td>'
					htmlStr += '<td>'+obj.owner+'</td>'
					htmlStr += '<td>'+obj.state+'</td>'
					htmlStr += '</tr>'
				})
				$("#clueTbody").html(htmlStr);

				var totalPages = 1;
				if(data.total%pageSize==0){
					totalPages = data.total/pageSize;
				}else {
					// 如果是小数，则调用parseInt()函数取整数部分
					totalPages = parseInt((data.total/pageSize)+1);
				};
				//对容器调用bs_pagination工具函数显示翻页信息
				$("#demo_page1").bs_pagination({
					currentPage:pageNo,//当前页，相当于分页查询的pageNo(调用queryActivityByConditionForPage(pageNo,pageSize)函数把形参传过来)
					totalRows:data.total,//总条数
					rowsPerPage:pageSize,//每页显示的条数，相当于pageSize
					totalPages: totalPages,//总页数，必填参数（等于总条数totalRows/每页显示条数rowsPerPage）
					visiblePageLinks: 10,//设置最多可以显示多少卡片数
					showGoToPage: true,//是否显示“跳转”部分，默认true--显示
					showRowsPerPage: true,//是否显示“每页条数”部分，默认true--显示
					showRowsInfo: true,//是否显示记录的信息 。默认true--显示
					showRowsDefaultInfo: true,
					/**
					 * 用户每次切换页号，都自动触发该函数
					 * 每次返回切换页号之后的pageNo和pageSize
					 */
					onChangePage: function(event,pageObj) { // returns page_num and rows_per_page after a link has clicked
						//js代码  queryActivityByConditionForPage(pageNo,pageSize)
						$("#checkAll").prop("checked",false);
						queryActivityByConditionForPage(pageObj.currentPage,pageObj.rowsPerPage)
					},
				});
			}
		});
	}
</script>
</head>
<body>

	<!-- 创建线索的模态窗口 -->
	<div class="modal fade" id="createClueModal" role="dialog">
		<div class="modal-dialog" role="document" style="width: 90%;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">创建线索</h4>
				</div>
				<div class="modal-body">
					<form id="clueAddForm" class="form-horizontal" role="form">

						<div class="form-group">
							<label for="create-clueOwner" class="col-sm-2 control-label">所有者<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="create-owner">
									<c:forEach items="${userList}" var="user">
										<option value="${user.id}">${user.name}</option>
									</c:forEach>
								</select>
							</div>
							<label for="create-company" class="col-sm-2 control-label">公司<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<input  type="text" class="form-control" id="create-company">
							</div>
						</div>

						<div class="form-group">
							<label for="create-call" class="col-sm-2 control-label">称呼</label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="create-appellation">
									<c:forEach items="${appellationList}" var="appellation">
										<option value="${appellation.id}">${appellation.value}</option>
									</c:forEach>
								</select>
							</div>
							<label for="create-surname" class="col-sm-2 control-label">姓名<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<input  type="text" class="form-control" id="create-fullname">
							</div>
						</div>

						<div class="form-group">
							<label for="create-job" class="col-sm-2 control-label">职位</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="create-job">
							</div>
							<label for="create-email" class="col-sm-2 control-label">邮箱</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="create-email">
							</div>
						</div>

						<div class="form-group">
							<label for="create-phone" class="col-sm-2 control-label">公司座机</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="create-phone">
							</div>
							<label for="create-website" class="col-sm-2 control-label">公司网站</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="create-website">
							</div>
						</div>
						
						<div class="form-group">
							<label for="create-mphone" class="col-sm-2 control-label">手机</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="create-mphone">
							</div>
							<label for="create-status" class="col-sm-2 control-label">线索状态</label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="create-state">
									<c:forEach items="${clueStateList}" var="clueState">
										<option value="${clueState.id}">${clueState.value}</option>

									</c:forEach>
								</select>
							</div>
						</div>
						
						<div class="form-group">
							<label for="create-source" class="col-sm-2 control-label">线索来源</label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="create-source">
									<c:forEach items="${sourceList}" var="source">
										<option value="${source.id}">${source.value}</option>
									</c:forEach>
								</select>
							</div>
						</div>
						

						<div class="form-group">
							<label for="create-describe" class="col-sm-2 control-label">线索描述</label>
							<div class="col-sm-10" style="width: 81%;">
								<textarea class="form-control" rows="3" id="create-description"></textarea>
							</div>
						</div>
						
						<div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative;"></div>
						
						<div style="position: relative;top: 15px;">
							<div class="form-group">
								<label for="create-contactSummary" class="col-sm-2 control-label">联系纪要</label>
								<div class="col-sm-10" style="width: 81%;">
									<textarea class="form-control" rows="3" id="create-contactSummary"></textarea>
								</div>
							</div>
							<div class="form-group">
								<label for="create-nextContactTime" class="col-sm-2 control-label">下次联系时间</label>
								<div class="col-sm-10" style="width: 300px;">
									<input type="text" readonly="readonly" class="form-control time" id="create-nextContactTime">
								</div>
							</div>
						</div>
						
						<div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative; top : 10px;"></div>
						
						<div style="position: relative;top: 20px;">
							<div class="form-group">
                                <label for="create-address" class="col-sm-2 control-label">详细地址</label>
                                <div class="col-sm-10" style="width: 81%;">
                                    <textarea class="form-control" rows="1" id="create-address"></textarea>
                                </div>
							</div>
						</div>
					</form>
					
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" id="create-save">保存</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 修改线索的模态窗口 -->
	<div class="modal fade" id="editClueModal" role="dialog">
		<div class="modal-dialog" role="document" style="width: 90%;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span>
					</button>
					<h4 class="modal-title">修改线索</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" role="form">
						<div class="form-group">
							<input type="hidden" id="edit-id">
							<label for="edit-owner" class="col-sm-2 control-label">所有者<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="edit-owner">
									<c:forEach items="${userList}" var="user">
										<option value="${user.id}">${user.name}</option>
									</c:forEach>
								</select>
							</div>
							<label for="edit-company" class="col-sm-2 control-label">公司<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-company" value="动力节点">
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-appellation" class="col-sm-2 control-label">称呼</label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="edit-appellation">
									<c:forEach items="${appellationList}" var="appellation">
										<option value="${appellation.id}">${appellation.value}</option>
									</c:forEach>
								</select>
							</div>
							<label for="edit-fullname" class="col-sm-2 control-label">姓名<span style="font-size: 15px; color: red;">*</span></label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-fullname" value="李四">
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-job" class="col-sm-2 control-label">职位</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-job" value="CTO">
							</div>
							<label for="edit-email" class="col-sm-2 control-label">邮箱</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-email" value="lisi@bjpowernode.com">
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-phone" class="col-sm-2 control-label">公司座机</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-phone" value="010-84846003">
							</div>
							<label for="edit-website" class="col-sm-2 control-label">公司网站</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-website" value="http://www.bjpowernode.com">
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-mphone" class="col-sm-2 control-label">手机</label>
							<div class="col-sm-10" style="width: 300px;">
								<input type="text" class="form-control" id="edit-mphone" value="12345678901">
							</div>
							<label for="edit-state" class="col-sm-2 control-label">线索状态</label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="edit-state">
									<c:forEach items="${clueStateList}" var="clueState">
										<option value="${clueState.id}">${clueState.value}</option>
									</c:forEach>
								</select>
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-source" class="col-sm-2 control-label">线索来源</label>
							<div class="col-sm-10" style="width: 300px;">
								<select class="form-control" id="edit-source">
									<c:forEach items="${sourceList}" var="source">
										<option value="${source.id}">${source.value}</option>
									</c:forEach>
								</select>
							</div>
						</div>
						
						<div class="form-group">
							<label for="edit-description" class="col-sm-2 control-label">描述</label>
							<div class="col-sm-10" style="width: 81%;">
								<textarea class="form-control" rows="3" id="edit-description">这是一条线索的描述信息</textarea>
							</div>
						</div>
						
						<div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative;"></div>
						
						<div style="position: relative;top: 15px;">
							<div class="form-group">
								<label for="edit-contactSummary" class="col-sm-2 control-label">联系纪要</label>
								<div class="col-sm-10" style="width: 81%;">
									<textarea class="form-control" rows="3" id="edit-contactSummary">这个线索即将被转换</textarea>
								</div>
							</div>
							<div class="form-group">
								<label for="edit-nextContactTime" class="col-sm-2 control-label">下次联系时间</label>
								<div class="col-sm-10" style="width: 300px;">
									<input type="text" class="form-control" id="edit-nextContactTime" value="2017-05-01">
								</div>
							</div>
						</div>
						
						<div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative; top : 10px;"></div>

                        <div style="position: relative;top: 20px;">
                            <div class="form-group">
                                <label for="edit-address" class="col-sm-2 control-label">详细地址</label>
                                <div class="col-sm-10" style="width: 81%;">
                                    <textarea class="form-control" rows="1" id="edit-address">北京大兴区大族企业湾</textarea>
                                </div>
                            </div>
                        </div>
					</form>
					
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" id="editSave" class="btn btn-primary" >更新</button>
				</div>
			</div>
		</div>
	</div>
	
	
	
	
	<div>
		<div style="position: relative; left: 10px; top: -10px;">
			<div class="page-header">
				<h3>线索列表</h3>
			</div>
		</div>
	</div>
	
	<div style="position: relative; top: -20px; left: 0px; width: 100%; height: 100%;">
	
		<div style="width: 100%; position: absolute;top: 5px; left: 10px;">
		
			<div class="btn-toolbar" role="toolbar" style="height: 80px;">
				<form class="form-inline" role="form" style="position: relative;top: 8%; left: 5px;">
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">名称</div>
				      <input id="search-fullname" class="form-control" type="text">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">公司</div>
				      <input id="search-company" class="form-control" type="text">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">公司座机</div>
				      <input id="search-phone" class="form-control" type="text">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">线索来源</div>
					  <select id="search-source" class="form-control">
						  <option></option>
						  <c:forEach items="${sourceList}" var="source">
							  <option value="${source.id}">${source.value}</option>
						  </c:forEach>
					  </select>
				    </div>
				  </div>
				  
				  <br>
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">所有者</div>
				      <input id="search-owner" class="form-control" type="text">
				    </div>
				  </div>
				  
				  
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">手机</div>
				      <input id="search-mphone" class="form-control" type="text">
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <div class="input-group">
				      <div class="input-group-addon">线索状态</div>
					  <select id="search-state" class="form-control">
						  <option></option>
						  <c:forEach items="${clueStateList}" var="clueState">
							  <option value="${clueState.id}">${clueState.value}</option>
						  </c:forEach>
					  </select>
				    </div>
				  </div>

				  <button type="button" id="searchBtn" class="btn btn-default">查询</button>
				  
				</form>
			</div>
			<div class="btn-toolbar" role="toolbar" style="background-color: #F7F7F7; height: 50px; position: relative;top: 40px;">
				<div class="btn-group" style="position: relative; top: 18%;">
				  <button type="button" id="addBtn" class="btn btn-primary" data-toggle="modal" ><span class="glyphicon glyphicon-plus"></span> 创建</button>
				  <button type="button" class="btn btn-default" data-toggle="modal" id="editBtn"><span class="glyphicon glyphicon-pencil"></span> 修改</button>
				  <button type="button" id="deleteBtn" class="btn btn-danger"><span class="glyphicon glyphicon-minus"></span> 删除</button>
				</div>
				
				
			</div>
			<div style="position: relative;top: 50px;">
				<table class="table table-hover">
					<thead>
						<tr style="color: #B3B3B3;">
							<td><input id="checkAll" type="checkbox" /></td>
							<td>名称</td>
							<td>公司</td>
							<td>公司座机</td>
							<td>手机</td>
							<td>线索来源</td>
							<td>所有者</td>
							<td>线索状态</td>
						</tr>
					</thead>
					<tbody id="clueTbody">
<%--						<tr>--%>
<%--							<td><input type="checkbox" /></td>--%>
<%--							<td><a style="text-decoration: none; cursor: pointer;" onclick="window.location.href='workbench/clue/detail.do';">李四先生</a></td>--%>
<%--							<td>动力节点</td>--%>
<%--							<td>010-84846003</td>--%>
<%--							<td>12345678901</td>--%>
<%--							<td>广告</td>--%>
<%--							<td>zhangsan</td>--%>
<%--							<td>已联系</td>--%>
<%--						</tr>--%>
<%--                        <tr class="active">--%>
<%--                            <td><input type="checkbox" /></td>--%>
<%--                            <td><a style="text-decoration: none; cursor: pointer;" onclick="window.location.href='workbench/clue/detail.do';">李四先生</a></td>--%>
<%--                            <td>动力节点</td>--%>
<%--                            <td>010-84846003</td>--%>
<%--                            <td>12345678901</td>--%>
<%--                            <td>广告</td>--%>
<%--                            <td>zhangsan</td>--%>
<%--                            <td>已联系</td>--%>
<%--                        </tr>--%>
					</tbody>
				</table>
				<div id="demo_page1"></div>
			</div>
			
<%--			<div style="height: 50px; position: relative;top: 60px;">--%>
<%--				<div>--%>
<%--					<button type="button" class="btn btn-default" style="cursor: default;">共<b>50</b>条记录</button>--%>
<%--				</div>--%>
<%--				<div class="btn-group" style="position: relative;top: -34px; left: 110px;">--%>
<%--					<button type="button" class="btn btn-default" style="cursor: default;">显示</button>--%>
<%--					<div class="btn-group">--%>
<%--						<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">--%>
<%--							10--%>
<%--							<span class="caret"></span>--%>
<%--						</button>--%>
<%--						<ul class="dropdown-menu" role="menu">--%>
<%--							<li><a href="#">20</a></li>--%>
<%--							<li><a href="#">30</a></li>--%>
<%--						</ul>--%>
<%--					</div>--%>
<%--					<button type="button" class="btn btn-default" style="cursor: default;">条/页</button>--%>
<%--				</div>--%>
<%--				<div style="position: relative;top: -88px; left: 285px;">--%>
<%--					<nav>--%>
<%--						<ul class="pagination">--%>
<%--							<li class="disabled"><a href="#">首页</a></li>--%>
<%--							<li class="disabled"><a href="#">上一页</a></li>--%>
<%--							<li class="active"><a href="#">1</a></li>--%>
<%--							<li><a href="#">2</a></li>--%>
<%--							<li><a href="#">3</a></li>--%>
<%--							<li><a href="#">4</a></li>--%>
<%--							<li><a href="#">5</a></li>--%>
<%--							<li><a href="#">下一页</a></li>--%>
<%--							<li class="disabled"><a href="#">末页</a></li>--%>
<%--						</ul>--%>
<%--					</nav>--%>
<%--				</div>--%>
<%--			</div>--%>
			
		</div>
		
	</div>
</body>
</html>